<template>
  <div class="agency_detail">
    <c-title :hide="false" text="捐赠详情"></c-title>
    <div class="detailBox">
      <div class="txt">捐赠金额（元）</div>
      <div class="price">{{info.amount}}</div>
      <div class="cell">
        <div class="cell_l">捐赠ID：</div>
        <div class="cell_r">{{info.id}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">订单号：</div>
        <div class="cell_r" v-if="info.order">{{info.order.order_sn}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">订单ID：</div>
        <div class="cell_r" v-if="info.order">{{info.order.id}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">支付时间：</div>
        <div class="cell_r" v-if="info.order">{{info.order.create_time}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">付款金额：</div>
        <div class="cell_r" v-if="info.order">￥{{info.order.price}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">获取积分：</div>
        <div class="cell_r">{{info.income}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">证书编号：</div>
        <div class="cell_r">{{info.certificate_no}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">会员ID：</div>
        <div class="cell_r">{{info.member_id}}</div>
      </div>
      <div class="cell">
        <div class="cell_l">会员手机号：</div>
        <div class="cell_r" v-if="info.member">{{info.member.mobile}}</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      info:[]
    };
  },
  activated() {
    this.getData();
  },
  methods:{
    getData(){
      $http
        .get(
          "plugin.donation-project.frontend.record.show",
          { id: this.$route.params.id },
          "加载中"
        )
        .then(res => {
          if (res.result === 1) {
            console.log(res.data)
            this.info = res.data.record;
          } else {
            this.$toast(res.msg);
          }
        })
        .catch(error => {
          console.log(error);
        });
    }
  }
};
</script>
<style lang="scss" scoped>
.detailBox {
  margin: 0.75rem;
  background-color: #fff;
  border-radius: 0.25rem;
  padding: 1.25rem 0.75rem;
  .txt {
    font-size: 0.94rem;
    line-height: 1.59rem;
  }
  .price {
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 2.56rem;
    color: #fe5e56;
    margin: 1rem;
    text-align: center;
  }
  .cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.81rem;
    margin-bottom: 0.75rem;
    .cell_l {
      color: #999999;
      flex-shrink: 0;
    }
    .cell_r {
      flex: 1;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      text-align: right;
    }
  }
  .cell:last-child{
    margin-bottom: 0;
  }
}
</style>
